﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddEditQuestionAnswer.ascx.cs" Inherits="Web.Cms.Questions.AddEditQuestionAnswer" %>
<%--nội dung câu hỏi--%>
 <div class="question" runat="server" id="divQuestion">
    <div class="cl"><asp:Label ID="lblUpdateStatus" runat="server" Font-Bold="true" ForeColor="red" 
                Font-Size="12px"></asp:Label></div> 
    <p class="heading">Thông tin câu hỏi</p>                             
    <div class="rows">
        <div class="fl width100" style="padding-top:5px;"> <b>Câu hỏi</b></div>
        <div class="fl"><asp:TextBox ID="txtQuestion" runat="server" CssClass="textbox-title" Height="25"></asp:TextBox></div>                        
    </div>     
    <div class="cl5"></div>
        <div class="rows">
        <div class="fl width100" style="padding-top:5px;"> <b>Thể loại câu hỏi</b></div>
        <div class="fl"> <asp:DropDownList ID="dropCategoryId" runat="server" CssClass="textbox-title" Height="20" Width="280"></asp:DropDownList>
        </div>                        
    </div>
    <div class="cl5"></div>
    <div class="rows">
        <div class="fl width100" style="padding-top:5px;"> <b>Đáp án cho phép</b></div>
        <div class="fl"> 
            <asp:DropDownList ID="dropAnswerType" runat="server" CssClass="textbox-title" Height="20" Width="180">
                <asp:ListItem Value="1">Một đáp án</asp:ListItem>
                <asp:ListItem Value="2">Nhiều đáp án</asp:ListItem>
            </asp:DropDownList>
        </div>                        
    </div>
    <div class="cl5"></div>
    <div class="fl" style="padding-left:100px;">
        <asp:LinkButton ID="btnAddQuestion" runat="server" CssClass="admin-btn-add" 
                onclick="btnAddQuestion_Click" />  
            <asp:LinkButton ID="btnUpdateQuestion" runat="server" CssClass="admin-btn-edit" 
                onclick="btnUpdateQuestion_Click"/>   
                  <asp:LinkButton ID="btnCanelQuestion" runat="server" CssClass="admin-btn-exit" 
            onclick="btnCanelQuestion_Click" />     
            <a href="/cms/Default.aspx?ctrlkey=QuestionManager" class="admin-btn-back" runat="server" id="alinkBack" visible="false"></a>
    </div>
</div>
<%--end nội dung câu hỏi--%>
<div class="cl5"></div>
<div class="cl5"></div>
<hr style="width:100%; color:#c0c0c0; height:1px;" />
<div class="cl"></div>
<%--nội dung đáp án--%>
<div class="answer" runat="server" id="divAnswer">
    <p class="heading">Đáp án câu hỏi </p>                                   
    <div class="rows">
        <div class="fl width100" style="padding-top:5px;"> <b>Câu trả lời</b></div>
        <div class="fl"><asp:TextBox ID="txtAnswer" runat="server" CssClass="textbox-title" Height="25"></asp:TextBox></div>                        
    </div>     
    <div class="cl5"></div> 
    <div class="rows">
        <div class="fl width100" style="padding-top:5px;"> <b>Giá trị</b></div>
        <div class="fl">
        <asp:DropDownList runat="server" ID="dropIsCorrect">
            <asp:ListItem Value="0">Sai</asp:ListItem>
            <asp:ListItem Value="1">Đúng</asp:ListItem>
        </asp:DropDownList>
        <asp:HiddenField ID="txtIsCorrect" runat="server" />
    </div>                        
    </div>
    <div class="cl5"></div>
    <div class="fl" style="padding-left:100px;">
        <asp:LinkButton ID="btnAdd" runat="server" CssClass="admin-btn-add" 
            onclick="btnAdd_Click" />  
        <asp:LinkButton ID="btnUpdate" runat="server" CssClass="admin-btn-edit" 
            onclick="btnUpdate_Click"/>
            <asp:LinkButton ID="btnCanel" runat="server" CssClass="admin-btn-exit" 
            onclick="btnCanel_Click" Visible="false"/>
                    
    </div>
    <div class="cl5"></div>
    <div>
        <asp:GridView ID="grdData" runat="server" SkinID="AdminGridView" BackColor="White" AutoGenerateColumns="False" onrowcommand="grdData_RowCommand">
            <Columns>               
            <asp:BoundField HeaderText="STT">
            <ItemStyle HorizontalAlign="Center" Width="20px" />
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle />
        </asp:BoundField>         
        <asp:BoundField HeaderText="Đáp án" DataField="Answer">            
        </asp:BoundField>         
            <asp:TemplateField HeaderText="Giá trị" HeaderStyle-Width="50">
            <ItemTemplate>       
            <%#Getvalue(Convert.ToInt32(Eval("IsCorrect")))%>                      
            </ItemTemplate>
            <HeaderStyle Width="50px"></HeaderStyle>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>                                 
        <asp:TemplateField HeaderText="Ngày tạo">
            <ItemTemplate>       
            <%# Convert.ToDateTime(Eval("CreatedDate")).ToString("dd/MM/yyyy HH:mm:ss")%>
            </ItemTemplate>
            <HeaderStyle Width="150"></HeaderStyle>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>                          
        <asp:TemplateField HeaderText="Sửa" HeaderStyle-Width="30">
            <ItemTemplate>     
                <a href="/cms/Default.aspx?ctrlkey=AddEditQuestionAnswer&answerId=<%# Eval("Id") %>&questionId=<%# Request.QueryString["questionId"] %>" class="mar2"> <img src="/App_Themes/Default/Images/i_rate.gif" border="0" /></a>                                         
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
            <HeaderStyle Width="30px"></HeaderStyle>
        </asp:TemplateField>                   
        <asp:TemplateField HeaderText="Xóa" HeaderStyle-Width="40">
            <ItemTemplate>             
                <asp:Button ID="btnDelete" runat="server" CssClass="Icon_Delete" CommandArgument='<%# Eval("Id") %>' CommandName="Commanddelete" OnClientClick="return confirm('Bạn có chắc chắn xóa không ?')" />                   
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
            <HeaderStyle Width="40px"></HeaderStyle>
        </asp:TemplateField>
    </Columns>
        </asp:GridView>
    </div>
</div>
<%--End nội dung đáp án--%>